﻿using System.Collections.Generic;
using System.Security.Claims;

namespace JNPF.Utils.HttpContextUser
{
    /// <summary>
    /// 用户抽象类
    /// </summary>
    public interface IUser
    {
        /// <summary>
        /// 用户名称
        /// </summary>
        string Name { get; }
        /// <summary>
        /// ID
        /// </summary>
        int ID { get; }
        /// <summary>
        /// 是否验证
        /// </summary>
        /// <returns></returns>
        bool IsAuthenticated();
        /// <summary>
        /// 获取身份声明
        /// </summary>
        /// <returns></returns>
        IEnumerable<Claim> GetClaimsIdentity();

        /// <summary>
        /// 根据类型获取身份声明
        /// </summary>
        /// <param name="ClaimType"></param>
        /// <returns></returns>
        List<string> GetClaimValueByType(string ClaimType);

        /// <summary>
        /// 获取ToKen
        /// </summary>
        /// <returns></returns>
        string GetToken();

        /// <summary>
        /// 获取用户信息表单Token
        /// </summary>
        /// <param name="ClaimType"></param>
        /// <returns></returns>
        List<string> GetUserInfoFromToken(string ClaimType);
    }
}
